package stardust.core.support;

import java.math.BigInteger;
import stardust.core.support.db.DataAccessObject;
import stardust.core.support.db.StardustDB;
import sun.security.util.BigInt;

public class SSQ
{

  public static void main(String[] args)
  {
//    DataAccessObject dao = StardustDB.getDataAccessObject();
    boolean[] cache = new boolean[34];
    
    cache[33] = true;
    
    innerScan(cache);
  }
  
  public static void innerScan(boolean[] cache)
  {
    long i = 0;
    do
    {
      System.out.print(i++ + " -> ");
      printNumber(cache);
    }
    while (inc(cache));
  }
  
  public static boolean inc(boolean[] cache)
  {
    boolean flag = false;
    
    i:
    for (int i = 1; i < cache.length ; i++)
    {
      if (cache[i])
      {
        for (int j = cache.length - 1; j >= i - 1; j--)
        {
          if (cache[j] == false)
          {
            cache[j] = true;
            flag = true;
            
            break i;
          }
          else
          {
            cache[j] = false;
          }
        }
      }
    }
    
    return flag;
  }
  
  public static void printNumber(boolean[] cache)
  {
    for (int i = 1; i < cache.length; i++)
    {
      if (cache[i])
      {
        System.out.print(i);
        System.out.print(", ");
      }
    }
    
    System.out.println();
  }
  
}
